<form id="form" action="<?php echo site_url(array('cliente','insertar'));?>" method="post">
	<fieldset class="form-fieldset"><legend>Datos del cliente</legend>
		<table class="form-table">
			<tr>
				<td><label>Documento:</label></td>
				<td>
					<input id="documento" maxlength="35" size="25" name="documento" class="validate[required, custom[number], minSize[8]]" value="<?php echo post_value('documento');?>"/>		
				</td>	
			</tr>	
			<tr>
				<td><label>Nombre:</label></td>
				<td>
					<input id="nombres" maxlength="25" size="25" name="nombres" class="validate[required]" value="<?php echo post_value('nombres');?>"/>
				</td>	
			</tr>
			<tr>
				<td><label>Apellido:</label></td>
				<td>
					<input id="apellidos" maxlength="35" size="25" name="apellidos" value="<?php echo post_value('apellidos');?>" class="validate[required]"/>	
				</td>	
			</tr>		 
			<tr>
				<td><label>Password:</label></td>
				<td>
					<input id="password" type="password" maxlength="25" size="25" name="password" class="validate[required], minSize[6]"/>
				</td>			
			</tr>	
			<tr>
				<td><label>Repita Password:</label></td>
				<td>
					<input id="cpassword" type="password" maxlength="25" size="25" name="cpassword" class="validate[required], equals[password], minSize[6]"/>
				</td>
			</tr>
			<tr>
				<td><label>Email:</label></td>
				<td>
					<input id="email" maxlength="35" size="25" name="email" value="<?php echo post_value('email');?>" class="validate[required,custom[email]]"/>
				</td>	
			</tr>
			<tr>
	   			<td><label for="pais_fk">Pais</label></td>
	   			<td>
					<select name="pais_fk">
						<option></option>
						<?php foreach ($paises as $pais):?>
						<option <?php echo 'selected="selected"';?> value=<?php echo $pais['id'];?>><?php echo $pais['nombre'];?></option>
						<?php endforeach;?>
					</select>
				</td>			    		
			</tr>
	   		<tr>
	   			<td><label for="departamento_fk">Departamento</label></td>
	   			<td>
					<select name="departamento_fk">
						<option></option>
						<?php foreach ($departamentos as $departamento):?>
						<option <?php if($departamento['id'] == post_value('departamento_fk')) echo 'selected';?> value=<?php echo $departamento['id'];?>><?php echo $departamento['nombre'];?></option>
						<?php  endforeach;?>
					</select>
				</td>		    		
			</tr>
			<tr>
				<td><label>Barrio:</label></td>
				<td>
					<input id="barrio" maxlength="35" size="25" name="barrio" value="<?php echo post_value('barrio');?>"/>
				</td>	
			</tr>
			<tr>
				<td><label>Direccion:</label></td>
				<td>
					<input id="direccion" maxlength="35" size="25" name="direccion" value="<?php echo post_value('direccion');?>"/>
				</td>	
			</tr>
			<tr>
				<td><label>Celular:</label></td>
				<td>
					<input id="celular" maxlength="35" size="25" name="celular" value="<?php echo post_value('celular');?>"/>
				</td>	
			</tr>
			<tr>
				<td><label>Coordenadas:</label></td>
				<td>
					<input id="coordenadas" maxlength="35" size="25" name="coordenadas" value="<?php echo post_value('coordenadas');?>"/>
				</td>
			</tr>
			
		</table>
		<table class="buttons-table">
			<tr>
				<td>
					<a class="button-image" href="<?php echo site_url(array('cliente'));?>">
			      		<img title="Volver" alt="Volver" src="<?php echo site_url(array('web', 'img', 'icon-back.png'));?>"/>
			      		<label>Volver</label>
			      	</a>
			      	
			      	<a class="button-image submitForm" href="#">
			      		<img title="Guardar" alt="Guardar" src="<?php echo site_url(array('web', 'img', 'icon-check.png'));?>"/>
			      		<label>Guardar</label>
			      	</a>
			   	</td>
			</tr> 
		</table>
	</fieldset>
</form>
